//
//  LanguageListView.swift
//  Chatup
//
//  Created by iron man on 2024/1/26.
//

import SwiftUI


struct LanguageListView: View {
    @Environment(\.presentationMode) var presentationMode
    @Binding var local:String
    @StateObject var viewModel = LanguageViewModel()
   

    var body: some View {
        List {
            // 遍历语言环境并显示
            ForEach(viewModel.data,id: \.self) { v in
                Text(v)
                    .font(.system(size: 16))
                    .foregroundColor(.white).onTapGesture {
                        local = v
                        presentationMode.wrappedValue.dismiss()
                    }
            }
        }
    }
}


